﻿#region Imports
using System;
using System.Drawing;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using CheckerWPF.Utils;
#endregion

namespace CheckerWPF.Converters
{
    public class HorizontalAlignmentConverter : IValueConverter
    {
        #region Converters
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            HorizontalAlignment hAlign = HorizontalAlignment.Left;
            if (Utilities.IsContentAlignment(value))
            {
                ContentAlignment align = (ContentAlignment)value;
                align = Utilities.GetOnlyLR(align, Utilities.left);

                if (align == Utilities.left) hAlign = HorizontalAlignment.Right;
            }

            return hAlign;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return new NotImplementedException();
        }
        #endregion
    }
}
